<?php

namespace app\cash\model;

use app\common\model\CommonModel;


class GuaBillModel extends CommonModel{

    protected  $name = 'cash_gua_bill';

    protected  $pk   = 'gua_bill_id';
    /**
     * 模型写入前事件（钩子函数）
     */
    public static function onBeforeInsert($model)
    {
        $model->set("add_time", date('Y-m-d H:i:s'));
        $model->set("add_ip", request()->ip());
    }
    public static function info($where,$field='*'){
        $list = self::where($where)->field($field)->find();
        return $list;
    }
}

